#pragma once

#include <gofcl_fwdgt_stat.h>

typedef struct {
	u16_s prescale_value_updating : 1;
	u16_s reload_value_updating : 1;
	u16_s : 14;
} fwdgt_stat_expl_s;

_Static_assert(sizeof(fwdgt_stat_expl_s) == 2,
	       "Struct fwdgt_stat_expl_s defined error!");

// 获取状态（寄存器是否正在更新）
static inline fwdgt_stat_expl_s fwdgt_get_stat(void) {
	union {
		fwdgt_stat_expl_s e;
		fwdgt_stat_s s;
	} es = {
		.s = fwdgt_rreg_stat_s(),
	};
	return es.e;
}
